package com.dc.controller;

import com.dc.handler.camera.SplService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @description: TODO 摄像头
 * @date: 2022/10/24 10:43
 * @author: zhang
 **/
@Api(tags = "摄像头设备管理")
@RestController
@RequestMapping("/splDevice")
@AllArgsConstructor
public class SplDeviceController {

    private final SplService getDeviceInfo;

    @ApiOperation(value = "获取摄像头设备信息", notes = "获取摄像头设备信息")
    @GetMapping("/getDeviceInfo")
    public String getDeviceInfo(@RequestParam(name = "page") int page) {
        return getDeviceInfo.getDeviceInfo(page);
    }

    @ApiOperation(value = "获取摄像头实时视频地址", notes = "获取摄像头实时视频地址")
    @GetMapping("/getGetVideoRealtime")
    public String getGetVideoRealtime(@RequestParam(name = "deviceCode") String deviceCode) {
        return getDeviceInfo.getGetVideoRealtime(deviceCode);
    }

    @ApiOperation(value = "获取摄像头某时间段历史视频地址", notes = "获取摄像头某时间段历史视频地址")
    @GetMapping("/getDeviceHistory")
    public String getDeviceHistory(@RequestParam(name = "deviceCode") String deviceCode,
                                   @RequestParam(name = "startTime") String startTime,
                                   @RequestParam(name = "endTime") String endTime) {
        return getDeviceInfo.getDeviceHistory(deviceCode, startTime, endTime);
    }

}


